package com.grz.mapper;

import com.grz.domain.Brand;
import com.grz.domain.Order;
import com.grz.domain.OrderItem;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface OrderMapper {
    int insertOrder(Order record);
    int insertOrderItem(OrderItem record);
    int insertOrder1(Order record);
    int batchInsertOrderItem(@Param("OrderItemList")List<OrderItem> orderItemList);

    /**
     * 根据id查询到订单的详情
     * @param id 订单id
     * @return 订单对象
     */
    Order selectOrderById(Integer id);

    /**
     * 根据订单id，查询这个订单下的订单明细
     * @param orderId 订单id
     * @return 订单明细的列表
     */
    List<OrderItem> selectOrderItemsByOrderId(Integer orderId);

    /**
     * 获取订单详情包括它的明细
     * @param id 订单id
     * @return 订单详情
     */
    Order getOrderDetail(Integer id);

    List<Order> getOrderList();
    Order selectOrderById2(Integer id);
    List<Order> selectOrderList2();
}
